package com.homework.ch01;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;

/**
 * @author yuxi
 * @version 1.0
 * @date 2025/10/22
 * @Description:
 */
public class Test3 {
    public static void main(String[] args) {
        System.out.println(typeConver(new Function<String, Integer>() {
            @Override
            public Integer apply(String s) {
                return Integer.parseInt(s);
            }
        }));
        Function<String, Integer> f1= Integer::parseInt;
        System.out.println(typeConver(f1));
    }
    public static <R> R typeConver(Function<String,R> function){
        String str = "1992";
        R result = function.apply(str);
        return result;
    }
}
